Skip to main content

Classes

Position​

  • int get_x()
  • int get_y()
  • double distance_to(Position)

Attacker​

  • size_t get_hp()
  • size_t get_id()
  • size_t get_type()
  • Position get_position()
  • size_t is_ability_active

PvPState​

  • const std::vector<Attacker>& get_attackers()
  • const std::vector<Attacker>& get_opponent_attackers()
  • size_t get_turn_no()
  • size_t get_coins_left()

Game​

  • void spawn_attacker(size_t type_id, Position pos): Spawns Attacker of type type_id at Position pos
  • bool already_spawned_at_position(Position pos): Given a Position pos, it will return whether some attacker was already spawned in that position in the current turn
  • std::set<size_t> already_activated_attacker_ids: Returns a set of attacker ids which had been activated till now. Its a static variable. Shouldnt be modified by the player , ideally a read only attribute
  • void set_target(size_t attacker_id, size_t opponent_attacker_id): Sets the target for Attacker with id=attacker_id as Attacker with id=opponent_attacker_id. If the opponent_attacker_id is invalid, the simulator will handle that automatically and try to set the target which is at the nearest position to your Attacker
  • void activate_ability(size_t attacker_id): Activates the ability for the given attacker with id=attacker_id. If the attacker_id is invalid it does nothing.
  • void set_target(const Attacker &attacker, const Attacker &opponent_atttacker): Sets the target for Attacker(attacker) as Atttacker(opponent_attacker). If the opponent_attacker is invalid somehow, the simulator will handle that automatically and try to set the target which is at the nearest position to your Attacker
  • std::ostringstream &logr(): Given a Game object(called game), you can do game.logr()<<"Log This\n"; and it will be shown in the renderer logs when the game is being rendered
  • const std::unordered_map<size_t, size_t> &get_player_set_targets()
  • const std::vector<std::pair<size_t, Position>> &get_spawn_positions()
  • const std::set<Position> &get_already_spawned_positions() const

AttackerType (Python Specific)​

  • hp: int
  • range: int
  • attack_power: int
  • price: int
  • speed: int
  • is_aerial: int

Attributes (C++ and Java Specific)​

This class stores the attributes for Attacker. This will be used as the value type in Constants for storing attributes of Attacker type.

  • unsigned hp
  • unsigned range
  • unsigned attackPower
  • unsigned speed
  • unsigned price
  • unsigned is_aerial
  • unsigned weight
  • unsigned ability_activation_cost

SpawnDetail (Java Specific)​

  • int getTypeId() : Returns the typeId of the spawn
  • Position getPos(): Returns the position of the spawn